3.3.27 \(\int \sqrt {a+\frac {b}{x}} \, dx\) [227]

Optimal. Leaf size=39 \[ \sqrt {a+\frac {b}{x}} x+\frac {b \tanh ^{-1}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{\sqrt {a}} \]

[Out]

b*arctanh((a+b/x)^(1/2)/a^(1/2))/a^(1/2)+x*(a+b/x)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {248, 43, 65, 214} \begin {gather*} x \sqrt {a+\frac {b}{x}}+\frac {b \tanh ^{-1}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{\sqrt {a}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[a + b/x],x]

[Out]

Sqrt[a + b/x]*x + (b*ArcTanh[Sqrt[a + b/x]/Sqrt[a]])/Sqrt[a]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^n/(b*(
m + 1))), x] - Dist[d*(n/(b*(m + 1))), Int[(a + b*x)^(m + 1)*(c + d*x)^(n - 1), x], x] /; FreeQ[{a, b, c, d, n
}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, -1] &&  !IntegerQ[n] && GtQ[n, 0]

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 248

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> -Subst[Int[(a + b/x^n)^p/x^2, x], x, 1/x] /; FreeQ[{a, b, p},
x] && ILtQ[n, 0]

Rubi steps

\begin {align*} \int \sqrt {a+\frac {b}{x}} \, dx &=-\text {Subst}\left (\int \frac {\sqrt {a+b x}}{x^2} \, dx,x,\frac {1}{x}\right )\\ &=\sqrt {a+\frac {b}{x}} x-\frac {1}{2} b \text {Subst}\left (\int \frac {1}{x \sqrt {a+b x}} \, dx,x,\frac {1}{x}\right )\\ &=\sqrt {a+\frac {b}{x}} x-\text {Subst}\left (\int \frac {1}{-\frac {a}{b}+\frac {x^2}{b}} \, dx,x,\sqrt {a+\frac {b}{x}}\right )\\ &=\sqrt {a+\frac {b}{x}} x+\frac {b \tanh ^{-1}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{\sqrt {a}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 39, normalized size = 1.00 \begin {gather*} \sqrt {a+\frac {b}{x}} x+\frac {b \tanh ^{-1}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{\sqrt {a}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[a + b/x],x]

[Out]

Sqrt[a + b/x]*x + (b*ArcTanh[Sqrt[a + b/x]/Sqrt[a]])/Sqrt[a]

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(73\) vs. \(2(31)=62\).
time = 0.02, size = 74, normalized size = 1.90

method result size
risch \(x \sqrt {\frac {a x +b}{x}}+\frac {b \ln \left (\frac {\frac {b}{2}+a x}{\sqrt {a}}+\sqrt {a \,x^{2}+b x}\right ) \sqrt {\frac {a x +b}{x}}\, \sqrt {x \left (a x +b \right )}}{2 \sqrt {a}\, \left (a x +b \right )}\) \(72\)
default \(\frac {\sqrt {\frac {a x +b}{x}}\, x \left (2 \sqrt {a \,x^{2}+b x}\, \sqrt {a}+b \ln \left (\frac {2 \sqrt {a \,x^{2}+b x}\, \sqrt {a}+2 a x +b}{2 \sqrt {a}}\right )\right )}{2 \sqrt {x \left (a x +b \right )}\, \sqrt {a}}\) \(74\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+1/x*b)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/2*((a*x+b)/x)^(1/2)*x*(2*(a*x^2+b*x)^(1/2)*a^(1/2)+b*ln(1/2*(2*(a*x^2+b*x)^(1/2)*a^(1/2)+2*a*x+b)/a^(1/2)))/
(x*(a*x+b))^(1/2)/a^(1/2)

________________________________________________________________________________________

Maxima [A]
time = 0.48, size = 50, normalized size = 1.28 \begin {gather*} \sqrt {a + \frac {b}{x}} x - \frac {b \log \left (\frac {\sqrt {a + \frac {b}{x}} - \sqrt {a}}{\sqrt {a + \frac {b}{x}} + \sqrt {a}}\right )}{2 \, \sqrt {a}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b/x)^(1/2),x, algorithm="maxima")

[Out]

sqrt(a + b/x)*x - 1/2*b*log((sqrt(a + b/x) - sqrt(a))/(sqrt(a + b/x) + sqrt(a)))/sqrt(a)

________________________________________________________________________________________

Fricas [A]
time = 3.50, size = 99, normalized size = 2.54 \begin {gather*} \left [\frac {2 \, a x \sqrt {\frac {a x + b}{x}} + \sqrt {a} b \log \left (2 \, a x + 2 \, \sqrt {a} x \sqrt {\frac {a x + b}{x}} + b\right )}{2 \, a}, \frac {a x \sqrt {\frac {a x + b}{x}} - \sqrt {-a} b \arctan \left (\frac {\sqrt {-a} \sqrt {\frac {a x + b}{x}}}{a}\right )}{a}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b/x)^(1/2),x, algorithm="fricas")

[Out]

[1/2*(2*a*x*sqrt((a*x + b)/x) + sqrt(a)*b*log(2*a*x + 2*sqrt(a)*x*sqrt((a*x + b)/x) + b))/a, (a*x*sqrt((a*x +
b)/x) - sqrt(-a)*b*arctan(sqrt(-a)*sqrt((a*x + b)/x)/a))/a]

________________________________________________________________________________________

Sympy [A]
time = 0.92, size = 42, normalized size = 1.08 \begin {gather*} \sqrt {b} \sqrt {x} \sqrt {\frac {a x}{b} + 1} + \frac {b \operatorname {asinh}{\left (\frac {\sqrt {a} \sqrt {x}}{\sqrt {b}} \right )}}{\sqrt {a}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b/x)**(1/2),x)

[Out]

sqrt(b)*sqrt(x)*sqrt(a*x/b + 1) + b*asinh(sqrt(a)*sqrt(x)/sqrt(b))/sqrt(a)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 64 vs. \(2 (31) = 62\).
time = 1.50, size = 64, normalized size = 1.64 \begin {gather*} -\frac {b \log \left ({\left | -2 \, {\left (\sqrt {a} x - \sqrt {a x^{2} + b x}\right )} \sqrt {a} - b \right |}\right ) \mathrm {sgn}\left (x\right )}{2 \, \sqrt {a}} + \frac {b \log \left ({\left | b \right |}\right ) \mathrm {sgn}\left (x\right )}{2 \, \sqrt {a}} + \sqrt {a x^{2} + b x} \mathrm {sgn}\left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b/x)^(1/2),x, algorithm="giac")

[Out]

-1/2*b*log(abs(-2*(sqrt(a)*x - sqrt(a*x^2 + b*x))*sqrt(a) - b))*sgn(x)/sqrt(a) + 1/2*b*log(abs(b))*sgn(x)/sqrt
(a) + sqrt(a*x^2 + b*x)*sgn(x)

________________________________________________________________________________________

Mupad [B]
time = 0.08, size = 58, normalized size = 1.49 \begin {gather*} x\,\sqrt {a\,x^2+b\,x}\,\sqrt {\frac {1}{x^2}}+\frac {b\,x\,\ln \left (\frac {\frac {b}{2}+a\,x+\sqrt {a}\,\sqrt {a\,x^2+b\,x}}{\sqrt {a}}\right )\,\sqrt {\frac {1}{x^2}}}{2\,\sqrt {a}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b/x)^(1/2),x)

[Out]

x*(b*x + a*x^2)^(1/2)*(1/x^2)^(1/2) + (b*x*log((b/2 + a*x + a^(1/2)*(b*x + a*x^2)^(1/2))/a^(1/2))*(1/x^2)^(1/2
))/(2*a^(1/2))

________________________________________________________________________________________